﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using TX.Core.Security;
using TX.Core.Data;

namespace TX.Passport.Models
{
    /// <summary>
    /// 用户
    /// </summary>
    [DefaultOrderby("DepartmentId")]
    public class Administrator   {
    
        #region 属性
        
        /// <summary>
        /// 
        /// </summary>
        [Required(ErrorMessage="不能为空")]
        [StringLength(50,ErrorMessage="输入过长，不能超过50位")]
        [Display(Name="")]
        public string UserName { get;set; } 
        
        /// <summary>
        /// 
        /// </summary>
        [Required(ErrorMessage="不能为空")]
        [StringLength(50,ErrorMessage="输入过长，不能超过50位")]
        [Display(Name="")]
        public string Password { get;set; } 
        
        /// <summary>
        /// 
        /// </summary>
        [Required(ErrorMessage="不能为空")]
        [StringLength(50,ErrorMessage="输入过长，不能超过50位")]
        [Display(Name="")]
        public string Name { get;set; } 
        
        /// <summary>
        /// 
        /// </summary>
        [Display(Name="")]
        public System.DateTime? ThisLoginDateTime { get;set; } 
        
        /// <summary>
        /// 
        /// </summary>
        [Display(Name="")]
        public System.DateTime? LastLoginDateTime { get;set; } 
        
        /// <summary>
        /// 
        /// </summary>
        [StringLength(16,ErrorMessage="输入过长，不能超过16位")]
        [Display(Name="")]
        public string ThisLoginIp { get;set; } 
        
        /// <summary>
        /// 
        /// </summary>
        [StringLength(16,ErrorMessage="输入过长，不能超过16位")]
        [Display(Name="")]
        public string LastLoginIp { get;set; } 
        
        /// <summary>
        /// 
        /// </summary>
        [Required(ErrorMessage="不能为空")]
        [Display(Name="")]
        public int LoginTimes { get;set; } 
        
        /// <summary>
        /// 
        /// </summary>
        [Display(Name="")]
        public System.Guid? PositionId { get;set; } 
        
        /// <summary>
        /// 
        /// </summary>
        [Display(Name="")]
        public System.Guid? DepartmentId { get;set; } 
        
        /// <summary>
        /// 
        /// </summary>
        [Required(ErrorMessage="不能为空")]
        [Display(Name="")]
        public int State { get;set; } 
        
        #endregion

        #region 关联属性
        
        /// <summary>
        /// 部门
        /// </summary>
        public virtual TX.Passport.Models.Department Department { get; set; }
        /// <summary>
        /// 职位
        /// </summary>
        public virtual TX.Passport.Models.Position Position { get; set; }
        /// <summary>
        /// Principals
        /// </summary>
        public virtual TX.Passport.Models.Principal Principal { get; set; }

        #endregion

        #region 构造方法
        /// <summary>
        /// 初始化
        /// </summary>
        public Administrator() {
        }
        #endregion

    }
}
